package cn.xw.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;

/**
 * @Auther: xiaoYang
 * @Date: 2021/4/6 12:38
 * @Description: 学生实体类
 */
//下面四个都是lombok插件注解
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName(value = "student")
public class Student implements Serializable {

    @TableId(type = IdType.ASSIGN_ID, value = "sid")   //主键生成雪花ID
    @TableField
    private Long id;           //学生ID
    @TableField(value = "sname")
    private String name;       //姓名
    @TableField(value = "ssex")
    private String sex;        //性别
    @TableField(value = "sage")
    private Integer age;       //年龄
    @TableField(value = "saddress")
    private String address;    //住址
    @TableField(value = "is_del")
    private Integer isDel;      //是否被删除 0未删除 1删除
    @TableField(value = "create_time")
    private Date createTime;    //数据行创建时间
    @TableField(value = "update_time")
    private Date updateTime;    //数据行更新时间
    private Integer version;    //版本（用于乐观锁）
}
